<%@ Language=VBScript %>
<% Option Explicit %>
<HTML>
	<HEAD>
		<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
	</HEAD>
	<BODY>

	<%
		Dim FileName, FileValue, fso, MyFile
		Const ForReading = 1, ForWriting = 2
		Dim RName, RightNow
		Dim Dates, Director, Group, CheckIn, About, Silent, Offering
		
		Sub GetDetails(RName)
			FileName = Server.MapPath("Text/db.txt")
			Set fso = Server.CreateObject("Scripting.FileSystemObject")
			Set MyFile = fso.OpenTextFile(FileName, ForReading)
				Do While Not MyFile.AtEndOfStream
					FileValue = MyFile.ReadLine
					'Response.Write "<b>FileValue = </b>" & FileValue & "<br>"
					If UCase(Left(FileValue,6))="[NAME]" Then
						If UCase(Right(FileValue, Len(FileValue)-6)) = UCase(RName) Then
							'Skip Title Tag
							FileValue = MyFile.ReadLine
							
							FileValue = MyFile.ReadLine
							Dates = Split(Right(FileValue, Len(FileValue)-7), "|")
							
							FileValue = MyFile.ReadLine
							Director = Split(Right(FileValue, Len(FileValue)-10), "|")
							
							FileValue = MyFile.ReadLine
							Group = Split(Right(FileValue, Len(FileValue)-7), "|")
							
							FileValue = MyFile.ReadLine
							CheckIn = Split(Right(FileValue, Len(FileValue)-9), "|")
							
							'Get the about details and combine them into 1 big string
							FileValue = MyFile.ReadLine
							If UCase(FileValue) = "[ABOUT]" Then
								FileValue = MyFile.ReadLine  'Get past the [About] tag
								Do While UCase(FileValue) <> "[/ABOUT]"
									About = About & FileValue
									FileValue = MyFile.ReadLine
								Loop
							End If
							
							FileValue = MyFile.ReadLine
							Offering = FormatCurrency(Right(FileValue, Len(FileValue)-10))
							
							If TypeName(Dates) = "Variant()" Then Dates = Join(Dates,"<br>")
							'Response.Write TypeName(Director)
							If TypeName(Director) = "Variant()" Then Director = Join(Director, "<br>")
							If TypeName(Group) = "Variant()" Then Group = Join(Group, "<br>")
							If TypeName(CheckIn) = "Variant()" Then CheckIn = Join(CheckIn, "<br>")
							Exit Do
						End If
					End If
				Loop
			MyFile.Close
			Set fso = Nothing
		End Sub
		
		GetDetails("12step")
		Response.Write Dates & "<BR>"
		Response.Write Director & "<br>"
		Response.Write Group & "<br>"
		Response.Write CheckIn & "<br>"
		Response.Write About & "<br>"
		Response.Write Offering & "<br>"
	%>

	</BODY>
</HTML>
